package com.example.shorg.utils;

import com.example.shorg.enums.CodeEnum;

/***
 * @author hmh
 * @date 2018/12/20
 * 枚举工具类
 * */
public class EnumStatusUtils {

    public static <T extends CodeEnum> T getByCode(Integer code, Class<T> tClass){
        for(T each: tClass.getEnumConstants()){
            if(code.equals(each.getCode())){
                return each;
            }
        }
        return null;
    }

}
